<!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8">
		<title></title>
		<meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=yes"/>
		<style>
			@media only screen and (min-width:960px ) {
				div {
					width: 25%;
				}
			}
			@media only screen and (min-width:640px) and (max-width:960px){
				div {
					width: 50%;
				}
			}
			@media only screen and (max-width:640px ) {
				div {
					width: 100%;
				}
			}
			
			
			
			div {
				height: 100px;
				float: left;
			}
			.a1 {
				background: red;
			}
			.a2 {
				background: green;
			}
			.a3 {
				background: yellow;
			}
			.a4 {
				background: black;
			}
		</style>
	</head>
	<body>
		<div class="a1"></div>
		<div class="a2"></div>
		<div class="a3"></div>
		<div class="a4"></div>
	</body>
</html>
